namespace Collaboris.Saf.Actions.Wss.Tests.Generated
{
    using System.IO;

    using Engine.Report;

    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Saf.Tests;

    using Wss.ContentMigration;

    using SharePoint.Wss.ContentMigration;

    [TestClass]
    public class ExportWebTest
    {
        /// <summary>
        /// This test was originally generated but has now been tested and verfiied by MJ
        /// </summary>
        [TestMethod]
        public void ExportWeb_Test()
        {
            WSSTestAssistant<ExportWeb, WebExportSettings> exportweb =
                    new WSSTestAssistant<ExportWeb, WebExportSettings>(TestEnvironment.PublishingSite,
                        "ExportWebTestWeb", "BLANKINTERNET#0");

            using (exportweb)
            {
                exportweb.FirstEntity.ExportSettings.BaseFileName = "exportweb_content.cmp";
                exportweb.FirstEntity.IgnoreSubWebs = false;

                string filename = Path.Combine(
                            exportweb.FirstEntity.ExportSettings.FileLocation,
                            exportweb.FirstEntity.ExportSettings.BaseFileName);

                if (File.Exists(filename))
                {
                    File.Delete(filename);
                }

                MacroReport doReport = exportweb.DoMacro();

                Assert.IsTrue(File.Exists(filename));

                // this should now - hopefully - go an import the list into the new web...
                ImportWebTest importWebTest = new ImportWebTest();
                importWebTest.ImportWeb_Test();

            }
        }

    }
}
